<?php
/**
 * FastApp.
 * 8/28/24
 * @Author 深色的海 (telegram:deepsea159)
 * @Contact tyy649909457@gmail.com
 */


use Swoole\Http\Server;
use Swoole\Http\Request;
use Swoole\Http\Response;

$server = new Server("0.0.0.0", 8999); // 替换为你想要监听的端口号

$server->on('request', function (Request $request, Response $response) {
    $response->header("Content-Type", "text/plain");
    $shell = "./wh.sh";
//    $data = json_decode($request->rawContent(), true);
//    if ($data['password'] == '')
    passthru($shell);
    $response->end("ok");
});

$server->start();